﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using V5_Common;
using System.Xml;
using V5_EShop.Data;

namespace V5_EShop.Admin {
    public partial class Admin_Index_Main : AdminPage {
        protected void Page_Load(object sender, EventArgs e) {
            if (!this.IsPostBack) {
                Bind_List();
                string gf_Version = string.Empty;
                string my_Version = string.Empty;
                #region 读取版本信息
                //XmlDocument myXml = new XmlDocument();

                //// 本地版本信息
                //string xmlPath = Server.MapPath("~/Config/Version.Config");
                //myXml.Load(xmlPath);
                //my_Version = myXml.SelectSingleNode("appSettings/add[@key='Version']").Attributes["value"].Value;

                //// 远程版本信息
                //string gf_xmlPath = "http://www.v5soft.com/Includes/V5EShop/Config/Version.Config";
                //try {
                //    myXml.Load(gf_xmlPath);
                //    gf_Version = myXml.SelectSingleNode("appSettings/add[@key='Version']").Attributes["value"].Value;
                //}
                //catch {
                //    gf_Version = "获取服务版本出错! 请联系QQ 83112223 ";
                //}
                this.lblVersion.Text = "您的版本为:" + my_Version + " 服务器版本为:" + gf_Version;
                #endregion
            }
        }


        private void Bind_List() {
            Bind_rpList1();
        }

        private void Bind_rpList1() {
            Repeater rp = (Repeater)this.FindControl("rpList1");
            if (rp != null) {

                //this.rpList1.DataSource = new BLLProductOrder().GetList(8, "", " OrderID Desc ").Tables[0];
                //this.rpList1.DataBind();
            }
        }

        /// <summary>
        /// 根据UserID 获取用户信息
        /// </summary>
        /// <param name="oUserID"></param>
        /// <returns></returns>
        public ModelUser Get_User(object oUserID) {
            int iUserID = InputHelper.SetNumber(oUserID);
            return new ModelUser(p => p.ID == iUserID);
        }
    }
}
